package com.itany.shop.service;

import com.itany.shop.entity.User;
import com.itany.shop.exception.*;

/**
 * @author 石小俊
 * @date 2023年09月19日 14:02
 */
public interface UserService {

    /**
     * 用户注册
     * 用户名不能重复
     * @param username
     * @param password
     * @param phone
     * @param address
     */
    void register(String username,String password,String phone,String address) throws RequestParameterErrorException, UserExistException;

    /**
     * 用户登录
     * @param username
     * @param password
     * @return
     */
    User login(String username,String password) throws RequestParameterErrorException, UserNotExistException;

    /**
     * 修改我的密码
     * @param user
     * @param oldPassword
     * @param newPassword
     */
    void modifyPassword(User user,String oldPassword,String newPassword,String newPassword2) throws UserNotLoginException, PasswordErrorException;
}
